package org.rasterfun.language2.bool

import org.rasterfun.language2.{BinaryOp, Context}

/**
 * Parent class for operations that work on two booleans and return a boolean.
 *
 * @author Hans Haggstrom
 */
sealed abstract class BinaryLogicOp(generatedOp: String, sourceOp: String, a : Bool, b : Bool) extends BinaryOp[Bool](generatedOp, sourceOp, a, b) with Bool

case class And(a: Bool, b: Bool) extends BinaryLogicOp("&&", "and", a, b)
case class Or(a: Bool, b: Bool) extends BinaryLogicOp("||", "or", a, b)
case class Xor(a: Bool, b: Bool) extends BinaryLogicOp("^^", "xor", a, b)
case class BoolEqual(a: Bool, b: Bool) extends BinaryLogicOp("==", "==", a, b)
case class BoolNotEqual(a: Bool, b: Bool) extends BinaryLogicOp("!=", "!=", a, b)

